package com.ymatou.iapi.productmanager.testcase;

import org.json.JSONObject;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.productmanager.service.GetExtraDeliveryRestrictedCountriesCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;


public class Ts_GetExtraDeliveryRestrictedCountries {
	
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取disconf restriced country配置");
	}

	@Before
	public void caseUp() {
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(new GetExtraDeliveryRestrictedCountriesCall().getOpurl());
	}
	
	
	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetExtraDeliveryRestrictedCountries_001() {
		Logger.start(true, "获取disconf restriced country配置");
		try{
			JSONObject ret = new GetExtraDeliveryRestrictedCountriesCall().callAndGetReturnData();
			Logger.verifyEquals(200, ret.getInt("Code"), "return code");
			Logger.verifyEquals(false, ret.getJSONObject("Data").isNull("ExtraDeliveryRestrictedCountries"), "ExtraDeliveryRestrictedCountries should not null");
			Logger.verifyEquals(true, ret.getJSONObject("Data").getJSONArray("ExtraDeliveryRestrictedCountries").length()>0, "ExtraDeliveryRestrictedCountries length >0");
			
			
		}catch(Exception e){
			Logger.fail(e);
		}
		
	}
	
	

}
